﻿
public class DataHandle
{
    public void OnRegist()
    {
        Facade.Instance.RegistNetEvent(nameof(notify_kick_rsp), OnNotifyKickRsp);
        Facade.Instance.RegistNetEvent(nameof(notify_error_rsp), OnNotifyErrorRsp);
    }

    public void OnUnRegist()
    {
        Facade.Instance.UnRegistNetEvent(nameof(notify_kick_rsp), OnNotifyKickRsp);
        Facade.Instance.UnRegistNetEvent(nameof(notify_error_rsp), OnNotifyErrorRsp);
    }

    private void OnNotifyKickRsp(System.Object data)
    {
        var rsp = data as notify_kick_rsp;
        UITips.Instance.Show("你被踢下线:" + rsp.msg);
    }

    private void OnNotifyErrorRsp(System.Object data)
    {
        var rsp = data as notify_error_rsp;
        UITips.Instance.Show("notify_error:" + rsp.reason + " code:" + rsp.ret);
    }
}

